package com.liang.design;

/**
 * @author Liangyaoyun
 */
public class Cat {
    private  Cat() {

    }
    private  String name;
    private  Integer age;

    private static  Cat cat1=new Cat();
    //静态内部类，什么时候使用什么时候调用
    private static final class CatHolder {
        private static final Cat cat = new Cat();
    }

    public   static  Cat insetrCat(){
        return CatHolder.cat;
    }
}
